def main():

  mapping="exp_pdnn/100_Str_25_dnn_fbank_128/data/train/FAEM0/split1/1/mapping"
  uttspk="exp_pdnn/100_Str_25_dnn_fbank_128/data/train/FAEM0/split1/1/utt2spk"
  
  mapping_file=open(mapping,'r')
  uttspk_file=open(uttspk,'r')
  dict1={}
  mapping_dict={} 
 
  for line in mapping_file:
    temp = line.rstrip().split()
    dict1[temp[0]]=int(temp[1])


  for line in uttspk_file:
    temp =line.rstrip().split()
    utt_name=temp[0]
    spk=temp[1]
    mapping_dict[dict1.get(utt_name)]=spk

  speakers=list(set(mapping_dict.values()))
  print len(mapping_dict)



if __name__=="__main__":
    main()

